package com.wqtz.chechai.view.activities;

import android.content.Intent;
import android.os.Bundle;
import android.widget.FrameLayout;
import android.widget.ImageView;
import android.widget.TextView;

import com.wqtz.chechai.R;
import com.wqtz.chechai.base.BaseActivity;
import com.wqtz.chechai.presenter.BasePresent;
import com.wqtz.chechai.utils.StringUtils;
import com.wqtz.chechai.view.fragments.TimeMonthFragment;
import com.wqtz.chechai.view.fragments.TimeYearFragment;

import butterknife.BindView;
import butterknife.ButterKnife;
import butterknife.OnClick;

/**
 * 项目名称： CheChai
 * 创建人 : Liberation
 * 创建时间: 2016/12/29 14:27
 */

public class TimeSelectActivity extends BaseActivity {
	String year;
	String month;
	@BindView(R.id.iv_back)
	ImageView mIvBack;
	@BindView(R.id.tv_title)
	TextView mTvTitle;
	@BindView(R.id.fm_year)
	FrameLayout mFmYear;

	@Override
	public void init() {
		ButterKnife.bind(this);
		fragmentManager(R.id.fm_year, new TimeMonthFragment(), "TimeMonthFragment");
		fragmentManager(R.id.fm_year, new TimeYearFragment(), "TimeYearFragment");
	}

	@Override
	public void loadData() {

	}

	@Override
	public int setContentViews() {
		return R.layout.activity_timeseleted;
	}

	@Override
	public BasePresent createPresenter() {
		return null;
	}

	public void setYear(String year) {
		this.year = year;
		mTvTitle.setText("选择月份");

	}

	public void setMonth(String month) {
		this.month = month;
		Intent intent = new Intent();
		intent.putExtra("year", year);
		intent.putExtra("month", month);
		setResult(RESULT_OK, intent);
		this.finish();
	}

	public void setTvTitle(String title) {
		mTvTitle.setText(title);

	}

	@Override
	protected void onResume() {
		super.onResume();
		activitys.add(this); //添加当前的activity
	}



	@OnClick(R.id.iv_back)
	public void onClick() {
		finish();
	}

}
